{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d00b79e2",
   "metadata": {},
   "source": [
    "### 上周学习回顾\n",
    "* python的第一行代码（hello world）\n",
    "* 观察标准库\n",
    "\n",
    "#### 重要学习资源\n",
    "> [python官网](https://www.python.org/)\n",
    "\n",
    "> [bolgs](https://www.cnblogs.com/xuzhichao)\n",
    "\n",
    "---\n",
    "\n",
    "### 本周学习内容\n",
    "1. python环境配置\n",
    "* [pycharm](https://www.jetbrains.com/pycharm/)\n",
    "* 项目管理类IDE\n",
    "* [github education](https://education.github.com/globalcampus/student)注册学生账号 获取学生福利\n",
    "\n",
    "2. 申请并注册下载pycharm专业版  \n",
    "\n",
    "\n",
    "3. 代码部分\n",
    "* **变量赋值&if/else**\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e5e5f8de",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82b70410",
   "metadata": {},
   "source": [
    "* **if/else嵌套练习**\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "962fa17d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "GREAT!\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "\n",
    "if today == \"Sunday\":\n",
    "    print(\"GREAT!\")\n",
    "elif today == \"Monday\":\n",
    "    if condition == \"Headache\":\n",
    "        print(\"You'd better have a rest!\")\n",
    "    else:\n",
    "        print(\"Go to class.\")\n",
    "else:\n",
    "    print(\"Study, work and study.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "25b76e35",
   "metadata": {},
   "source": [
    "* **for循环 内置函数range()**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "dc138419",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world!\n",
      "hello world!\n",
      "hello world!\n",
      "hello world!\n",
      "hello world!\n"
     ]
    }
   ],
   "source": [
    "\n",
    "for i in range(5):\n",
    "      print(\"hello world!\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c47b15b",
   "metadata": {},
   "source": [
    "* **random模块**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "7533e72b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd second.\n",
      "This second seems a little odd.\n",
      "This second seems a little odd.\n",
      "Not an odd second.\n",
      "This second seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "import random\n",
    "import time\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "for i in range(5):   #for的子集将被实现5次\n",
    "    right_this_second = datetime.today().second\n",
    "    if right_this_second in odds:\n",
    "        print(\"This second seems a little odd.\")\n",
    "    else:\n",
    "        print(\"Not an odd second.\")\n",
    "    wait_time = random.randint(1,5)\n",
    "    time.sleep(wait_time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "44dfacf4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
